package com.asset.service.impl;

import com.asset.mapper.AllocateMapper;
import com.asset.model.dto.allocate.AllocateQuery;
import com.asset.model.vo.AllocateVO;
import com.asset.model.vo.AseetTranferVo;
import com.asset.service.AllocateService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

@Service
public class AllocateServiceImpl implements AllocateService {

    @Autowired
    private AllocateMapper allocateMapper;

    private static final long serialVersionUID = 8944750783180202971L;
//    private String assetName;//资产名称
//    private int type;//资产类型
//    private String outCompany;//调出公司
//    private String inCompany;//调入公司
//    private Timestamp startTime;//调拨开始的时间
//    private Timestamp endTime;//调拨结束的时间

    @Override
    public List<AllocateVO> getAllocate(AllocateQuery allocateRequest) {
        String assetName = allocateRequest.getAssetName();
        int type = allocateRequest.getType();
        String outCompany = allocateRequest.getOutCompany();
        String inCompany = allocateRequest.getInCompany();
        Date startTime = allocateRequest.getStartTime();
        Date endTime = allocateRequest.getEndTime();
        List<AllocateVO> allocateVOList = allocateMapper.allocateSelectAll(assetName, type,outCompany,inCompany,startTime,endTime);
        return allocateVOList;
    }

    @Override
    public List<AseetTranferVo> getAllocateById(Integer transferId) {
        return allocateMapper.getAllocateById(transferId);
    }

    @Override
    public List<AseetTranferVo> clickBtn(Integer companyId) {
        return allocateMapper.clickBtn(companyId);
    }


}
